﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Profile;

namespace COFE.Core.Utils
{
    /// <summary>
    /// COFE version of System.IO.Directory static class, which provide static-like-methods to manipulate directories.
    /// </summary>
    public interface IDirectoryServices
    {
        /// <summary>
        /// Set by the parent manager.
        /// </summary>
        IUserProfile UserProfile { get; set; }

        /// <summary>
        /// Copy one directory (include that directory) and its contents to another.
        /// </summary>        
        void Copy(string sourceDirectoryPath, string destDirectoryPath);

        /// <summary>
        /// Create a directory.
        /// </summary>
        /// <param name="path"></param>
        IDirectoryInfo CreateDirectory(string path);

        /// <summary>
        /// Create a virtual directory.
        /// </summary>
        /// <param name="path"></param>
        IDirectoryInfo CreateVirtualDirectory(string path, string type);

        /// <summary>
        /// Delete a directory.
        /// </summary>        
        void Delete(IDirectoryInfo item);

        /// <summary>
        /// Delete a directory.
        /// </summary>
        void Delete(string path);

        /// <summary>
        /// Whether the specify directory exists.
        /// </summary>
        bool Exists(string path);

        /// <summary>
        /// Move a directory to destionation.
        /// </summary>
        void Move(string srcDirName, string destDirName);

        /// <summary>
        /// Get a list of directories inside the specified directory.
        /// </summary>
        string[] GetDirectories(string path, string searchPattern, SearchOptionEx searchOption);

        /// <summary>
        /// Get a list of directories inside the specified directory.
        /// </summary>
        string[] GetDirectories(string path, string searchPattern);
        
        /// <summary>
        /// Get a list of directories inside the specified directory.
        /// </summary>
        string[] GetDirectories(string path);

        /// <summary>
        /// Get a list of files inside the specified directory.
        /// </summary>
        string[] GetFiles(string path, string searchPattern, SearchOptionEx searchOption);

        /// <summary>
        /// Get a list of files inside the specified directory.
        /// </summary>
        string[] GetFiles(string path, string searchPattern);

        /// <summary>
        /// Get a list of files inside the specified directory.
        /// </summary>
        string[] GetFiles(string path);

        /// <summary>
        /// Get a list of entries inside the specified directory.
        /// </summary>
        string[] GetFileSystemEntries(string path, string searchPattern, SearchOptionEx searchOption);

        /// <summary>
        /// Get a list of entries inside the specified directory.
        /// </summary>
        string[] GetFileSystemEntries(string path, string searchPattern);

        /// <summary>
        /// Get a list of entries inside the specified directory.
        /// </summary>
        string[] GetFileSystemEntries(string path);    

        /// <summary>
        /// Return parent of the specified directory.
        /// </summary>
        IDirectoryInfo GetParent(string path);

        /// <summary>
        /// Return root directory of the specified directory.
        /// </summary>
        string GetDirectoryRoot(string path);
    }
}
